﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace CodeNameGame
{
    class MainPlayer
    {
        public Vector3 m_position = new Vector3(0, 0, 0);
        public float m_angle = 0;
        private Texture2D m_texture;
        public Model model;

        public void LoadTexture(ContentManager theContentManager, string theAssetName)
        {
            m_texture = theContentManager.Load<Texture2D>(theAssetName);
        }

        public void LoadModel(ContentManager theContentManager, string theAssetName)
        {
            model = theContentManager.Load<Model>(theAssetName);
        }
    
        public void DrawPlayer(Matrix world, Matrix view, Matrix projection)
        {
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.World = world;
                    effect.View = view;
                    effect.Projection = projection;
                    effect.Texture = m_texture;
                }
                mesh.Draw();
            }
        }
    }
}
